<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
      body,
      html {
        padding: 0;
        margin: 0;
      }

      @page {
        margin: 0px;
      }

      p,
      h1,
      h4 {
        margin: 0;
        padding: 0;
      }

      #container {
        /* width: 685px; */
        text-align: center;
        margin: 50px auto 0;
        /* border: 1px solid #ddd; */
        /* background-color: #ffa07a; */
      }

      .title,
      .subtitle {
        font-size: 18px;
        line-height: 36px;
      }

      .seatnum {
        /* font-size: 38px; */
        font-weight: bold;
        line-height: 45px;
      }
      .gydate {
        font-size: 18px;
        font-weight: bold;
        line-height: 36px;
      }
      .note-1,
      .note-2 {
        font-size: 18px;
        line-height: 30px;
      }
    </style>
  </head>

  <body id="bd">
    <div id="container">
      <p class="title">看戏 \ 喝茶 \ 聚友 \ 聊天</p>
      <p class="subtile">老有所乐在南普</p>
      <h1 id="seatnum" class="seatnum">002</h1>
      <h4 id="gydate" class="gydate">观演日期2020年10月28日</h4>
      <p id="note1" class="note-1">于当日下午2点入场</p>
      <p id="note2" class="note-2">2点30分开演后禁止入场</p>
    </div>
  </body>

  <script>
    const { ipcRenderer } = require("electron");
    ipcRenderer.on("webview-print-render", (event, info) => {
      // console.log(info);
      // 执行渲染
      document.getElementById("seatnum").innerHTML = info.html.seatnum;
      document.getElementById("gydate").innerHTML = info.html.gydate;
      document.getElementById("note1").innerHTML = info.html.note1;
      document.getElementById("note2").innerHTML = info.html.note2;
      ipcRenderer.sendToHost("webview-print-do");
    });
  </script>
</html>
